package cn.cytong.util.ext

import org.junit.Test
import java.math.BigDecimal
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals


/**
 * Created by orangeJ on 2017-06-10.
 */
class DecimalKtTest {
    @Test
    fun testDecimal() {
        val decimal = 1.2.toDecimal()
        val value = decimal * 2.toDecimal()
        assertEquals(BigDecimal("1.2"), decimal)
        assertNotEquals(0, decimal.compareTo(BigDecimal(1.2)))
        assertEquals(0, 1.0.toDecimal().compareTo(BigDecimal(1)))

    }
}